{layout name='/base'}
	<style type="text/css">
    	/*后台ajax返回数据提示页面*/
		#hd-alert {
		  padding: 40px 20px 6px;
		  float: left;
		  position: fixed;
		  font-size: 25px;
		  color: #FFFFFF;
		  top: -100px;
		  left: 50%;
		  margin-left: -50px;
		  border-radius: 5px;
		  background: #00AA00;
		  z-index: 9999;
		}
    </style>
    <div class="row">
      <div class="col-lg-12">
        <h1>管理员管理 <small>管理员信息列表</small></h1>
        <ol class="breadcrumb">
          <li><a href="/index"><i class="fa fa-dashboard"></i> 管理首页</a></li>
          <li class="active"><i class="fa fa-table"></i> 管理员信息列表</li>
        </ol>
        <div class="alert alert-success alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          这里可以添加、修改、删除管理员信息 
        </div>
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
      <div class="col-lg-12">
      	<form action="/managerset" method="get">
	        <div class="form-group input-group" style="width:50%;float:right;">
	          <input class="form-control" type="text" placeholder="账号/负责人姓名/联系电话" name="keyword">
	          <span class="input-group-btn">
	            <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
	          </span>
	        </div>
	        <div class="form-group col-sm-2 " style=";float:right;">
            <select class="form-control" name="searchfield">
              <option value="">请选择搜索条件</option>
              <option value="account">账号</option>
              <option value="real_name">负责人姓名</option>
              <option value="mobile">联系电话</option>
            </select>
          </div>
       	</form>
       <div class="btn-group">
          <a href="/managerset/create" class="btn btn-primary">添加管理员</a>
        </div>
        <div class="btn-group">
          <button type="button" class="btn btn-default" id='forcedel'>删除</button>
        </div>
        <div class="btn-group">
          <button type="button" class="btn btn-default" id='lockManager'>锁定</button>
        </div>
        <div class="btn-group">
          <button type="button" class="btn btn-default" id='unblockManager'>解锁</button>
        </div>
        <div class="table-responsive">
          <table class="table table-bordered table-hover table-striped tablesorter">
            <thead>
              <tr>
                <th><div class="checker"><span><input type="checkbox"></span></div></th>
                <th>账号</th>
                <th>负责人姓名</th>
                <th>联系电话</th>
                <th>邮箱地址</th>
                <th>通讯地址</th>
                <th>最后登录IP</th>
                <th>最后登录时间</th>
                <th>状态</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
            	{foreach $managerInfo as $value}
	              <tr>
	                <td><div class="checker"><span><input type="checkbox" name="ids[]" value="{$value.id}"></span></div></td>
	                <td>{$value.account}</td>
	                <td>{$value.real_name}</td>
	                <td>{$value.mobile}</td>
	                <td>{$value.email}</td>
	                <td>{$value.address}</td>
	                <td>{$value.ip}</td>
	                <td>{$value.created_at}</td>
	                <td>{$value.status}</td>
	                <td><a href="/managersetinfo/personinfo?uuid={$value.id}&account={$value.account}">查看</a></td>
	              </tr>
                {/foreach}
            </tbody>
          </table>
        </div> 
      </div>
    </div>
    <!-- /.row -->
<script type="text/javascript">
	function param(){
		var ids = [];
		$('input[type="checkbox"]:checked').each(function(){
			ids.push($(this).val());
		})
		return ids;
	}
    $("#forcedel").click(function(){
    	if(confirm('确定删除吗')){
    		var ids =param();
    		hd_ajax('/del',{ids},'/managerset',$('input[type="checkbox"]:checked'),'tr');
    	}
    });
    $("#lockManager").click(function(){
    	var ids =param();
    	hd_ajax('/setManagerStatus?num=0',{ids},'/managerset');
    });
    $("#unblockManager").click(function(){
    	var ids =param();
    	hd_ajax('/setManagerStatus?num=1',{ids},'/managerset');
    });
</script>
